<?php
$post = C('post');
$openid = C('openid'); // app_init
$wxuser = C('wxuser');

$userService = loadService('User');
$userService->addItem(array(
    'openid' => $openid,
    'nickname' => $wxuser['nickname'],
    'avatar' => $wxuser['avatar']
));

// 提交申请
if(!empty($post)) {
    $str = $post['content'];
    if(strlen($str)>500) responseJson(1, "单次最大生成500字符");
	$qrimg = QR::createQRCode($str);
    responseJson(array(
        'qrimg' => $qrimg
    ));
}

loadView(); // 默认加载同名
?>
